﻿<controls:ChildWindow x:Class="SomethingSpacial.Views.Admin.EventAdd"
            xmlns:dataControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"  
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
            xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
            xmlns:app="clr-namespace:SomethingSpacial.ControlDataProviders"
            xmlns:App="clr-namespace:SomethingSpacial.Web"
            Width="500" Height="500" 
            Title="Add an Event">
    <Grid x:Name="LayoutRoot" Margin="2">

        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
     
        <dataControls:DataForm x:Name="addEventDataForm"   AutoGenerateFields="False" AutoCommit="True" AutoEdit="True" CommandButtonsVisibility="None">
            <dataControls:DataForm.EditTemplate>
                <DataTemplate>
                    <StackPanel>
                        <dataControls:DataField Label="Event Name:" >
                            <TextBox Text="{Binding NameInEvent, Mode=TwoWay}"  Width="200" HorizontalAlignment="Left" />
                        </dataControls:DataField>
                        <dataControls:DataField Label="Description:">
                            <TextBox Text="{Binding  DescriptionInEvent, Mode=TwoWay}" Width="280" Height="120" HorizontalAlignment="Left"  TextWrapping="Wrap" />
                        </dataControls:DataField>
                        <dataControls:DataField Label="Location"  HorizontalAlignment="Left" >
                            <ComboBox   x:Name="comboBoxLocations" Width="150" />
                        </dataControls:DataField>
                        <dataControls:DataField Label="Start Date" x:Name="textStartDate" >
                            <controls:DatePicker Text="{Binding StartDateInEvent, Mode=TwoWay}" Width="100"  HorizontalAlignment="Left" ></controls:DatePicker>
                        </dataControls:DataField>
                        <dataControls:DataField Label="Start Time" x:Name="textStartTime">
                            <TextBox Text="" Width="80" HorizontalAlignment="Left" x:Name="textBlockTime"  />
                        </dataControls:DataField>
                        <dataControls:DataField Label="Registration URL:">
                            <TextBox Text="{Binding RegistrationURLInEvent, Mode=TwoWay}" HorizontalAlignment="Left" Width="200"  />
                        </dataControls:DataField>
                    </StackPanel>
                </DataTemplate>
            </dataControls:DataForm.EditTemplate>
        </dataControls:DataForm>


        <Button x:Name="CancelButton" Content="Cancel" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
        <Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,79,0" Grid.Row="1" />
    </Grid>
</controls:ChildWindow>